#pragma once
#include "Rpg/Log.h"
#include "RPG/Window.h"


struct GLFWwindow;

namespace Rpg {
	class WindowsWindow: public Window
	{
	public:
		WindowsWindow(const WindowProps& props);
		virtual	~WindowsWindow();

	 inline	unsigned int GetWidth() const override { return m_Data.Width; };
	 inline	unsigned int GetHeight() const override { return m_Data.Height; };
	
	 void OnUpdate() override;

	 virtual void SetEventCallback(const EventCallbackFn& callback) override {
		 m_Data.EventCallback = callback;
	 };
	 virtual void SetVSync(bool sync) override;
	 virtual bool IsVSync() const override;
	  void* GetNativeWindow() const override {return m_Window;}
	private:
		virtual void Init(const WindowProps& props);
		virtual void Shutdown();
	private:
		GLFWwindow* m_Window;
		struct WindowData
		{
			std::string Title;
			unsigned int Width;
			unsigned int Height;

			bool VSync;

			EventCallbackFn EventCallback;
		};

		WindowData m_Data;
	};
}